<template>
  <el-container class="layout">
    <el-aside width="200px">
      <el-menu
        router
        :default-active="route.path"
        class="menu"
      >
        <el-menu-item index="/">
          <el-icon><Monitor /></el-icon>
          <span>设备管理</span>
        </el-menu-item>
        <el-menu-item index="/scene">
          <el-icon><Setting /></el-icon>
          <span>场景管理</span>
        </el-menu-item>
        <el-menu-item index="/timer">
          <el-icon><Clock /></el-icon>
          <span>定时任务</span>
        </el-menu-item>
      </el-menu>
    </el-aside>
    <el-main>
      <router-view v-slot="{ Component }">
        <component :is="Component" />
      </router-view>
    </el-main>
  </el-container>
</template>

<script setup>
import { onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import { Monitor, Setting, Clock } from '@element-plus/icons-vue'

const route = useRoute()
const router = useRouter()

onMounted(() => {
  console.log('Layout mounted, current route:', route.path)
})
</script>

<style lang="scss" scoped>
.layout {
  height: 100vh;
  
  .menu {
    height: 100%;
    border-right: none;
  }
}
</style> 